<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
    <script>

      //Number构造函数 ->window.Number
    var num = 123  // new Number(num)
    console.log(window)

    //类属性  静态属性
    //Number中本身也是有自己的属性
    console.log(Number.MAX_VALUE)
    console.log(Number.MIN_VALUE)
    //integer: 整数
    console.log(Number.MAX_SAFE_INTEGER)//获取最大的整数
    console.log(Number.MIN_SAFE_INTEGER)//最小整数
    
    //对象的方法
    var num = 100000000000
    console.log(num.toString(),typeof num.toString())
    console.log(num.toString(2))//转成二进制的字符串
    console.log(123..toString(2))

    var pi = 3.1415926
    console.log(pi.toFixed(2))
    console.log(pi.toFixed(4))

    //类方法
    //整数：123
    //浮点数：小数  123.321
    var num1 = "123.321"
    console.log(Number(num1))
    console.log(Number.parseInt(num1))
    console.log(Number.parseFloat(num1))
    console.log("======================")
    //window对象上面
    console.log(parseInt(num1))
    console.log(parseFloat(num1))
    console.log(window.parseInt === Number.parseInt)
    </script>
</body>
</html>